Technical Field
The embodiments herein generally relates to computer software and particularly relates to a testing of computer software. The embodiments herein more particularly relates to a method of obtaining code coverage data for only those lines of code which have changed in the given period of time or between a given set of file versions. The embodiments herein is further related to a system and method for providing a discriminated code coverage information.
Description of the Related Art
In computer software, code coverage refers to a measure used to describe the degree to which the source code of a program is tested by a particular test suite. A program with high code coverage has been more thoroughly tested and has a lower chance of containing the software bugs than a program with low code coverage. Code coverage was among the first methods invented for systematic software testing.
One of the conventional code coverage methods provide data that includes information such as the percentage of source code which is covered during testing, percentage of program subroutines, percentage and number of program statements, percentage and number of branches called during the execution of the test suit and the like.
However, only overall code coverage data is not sufficient to take appropriate judgment about potential risks of defects in an application, as large applications contain large number of source code lines, which makes it difficult and time consuming to get high code coverage on all the lines of code. Further, the source code lines (and branches) that are not changed between two given versions and where the old version of the application has been deployed and used in production can be assumed to work effectively and have lower risk of having bugs. Therefore, it is essential to focus the testing and code coverage effort on the source codes lines and branches that have been changed between the given two or more versions to obtain a useful code coverage data for high risk lines and branches.
Hence, there is a need for a method and system to provide delta code coverage information on a line level or branch level. Further, there is a need for a method and system to provide a time based delta code coverage information. Still further there is need for a method and system to provide a specific path based delta code coverage information. Still further there is need for a method and system to provide a discriminated code coverage information. Still further there is a need for a method and system for generating code coverage results for changed lines.
Hence, there is a need for a method and system that overcomes the above mentioned disadvantages. The above mentioned shortcomings, disadvantages and problems are addressed herein and which will be understood by reading and studying the following specification.